<template>
  <div name="app">
    <header>
      <!-- 主题导航 -->
      <MainNav></MainNav>
    </header>

    <section>
      <!-- Banner -->
      <Banner></Banner>

      <!-- 推荐入口列表 -->
      <div class="Recommend con_width">
        <ul class="Recommend_left">
          <li class="list">
            <div class="list_con down_border">
              <img class="img" src="/images/recom1.png" alt />
              <div class="label">小米秒杀</div>
            </div>
          </li>
          <li class="list left_border">
            <div class="list_con down_border">
              <img class="img" src="/images/recom2.png" alt />
              <div class="label">企业团购</div>
            </div>
          </li>
          <li class="list left_border">
            <div class="list_con down_border">
              <img class="img" src="/images/recom3.png" alt />
              <div class="label">F码通道</div>
            </div>
          </li>
          <li class="list">
            <div class="list_con">
              <img class="img" src="/images/recom4.png" alt />
              <div class="label">米粉卡</div>
            </div>
          </li>
          <li class="list left_border">
            <div class="list_con">
              <img class="img" src="/images/recom5.png" alt />
              <div class="label">以旧换新</div>
            </div>
          </li>
          <li class="list left_border">
            <div class="list_con">
              <img class="img" src="/images/recom6.png" alt />
              <div class="label">话费充值</div>
            </div>
          </li>
        </ul>
        <div class="Recommend_right">
          <router-link to="/comdetail">
            <img class="image" src="/images/recom_img1.jpg" alt />
          </router-link>
          <router-link to="/comdetail">
            <img class="image" src="/images/recom_img2.jpg" alt />
          </router-link>
          <router-link to="/comdetail">
            <img class="image" src="/images/recom_img3.jpg" alt />
          </router-link>
        </div>
      </div>

      <!-- 灰色背景部分 -->
      <div class="detail_content">
        <div class="con_width">
          <!-- 标题 -->
          <div class="content_title">
            <div class="title_left">小米抢购</div>
            <div class="title_right">
              <div class="check_box">
                <div :class="[paincheck_left?'stopbtn':'','icon']" @click="panicleftbtn">
                  <i class="iconfont icon-zuo"></i>
                </div>
                <div :class="[paincheck_right?'stopbtn':'','icon']" @click="panicrightbtn">
                  <i class="iconfont icon-you"></i>
                </div>
              </div>
            </div>
          </div>
          <!-- 小米抢购 -->
          <div class="Panic_buy">
            <div class="Panic_left">
              <div class="Countdown">
                <div class="round">{{startTimetext}} 场</div>
                <div class="sandian_icon">
                  <i class="iconfont icon-shandian"></i>
                </div>
                <div class="tips_text" v-if="Panicshow == 0">本场活动暂未开始</div>
                <div class="tips_text" v-else-if="Panicshow == 1">距离结束还有</div>
                <div class="tips_text" v-else>本场已结束</div>
                <div class="Countdown_time">
                  <div class="time_box">{{hr}}</div>
                  <div class="time_hao">:</div>
                  <div class="time_box">{{min}}</div>
                  <div class="time_hao">:</div>
                  <div class="time_box">{{sec}}</div>
                </div>
              </div>
            </div>
            <div class="Panic_right">
              <ul class="Panic_listbox" :style="'left:' + panicstyle + 'px;'">
                <li
                  :class="[
                index%5==0?'top_color1':'' || 
                index%5==1?'top_color2':'' || 
                index%5==2?'top_color3':'' || 
                index%5==3?'top_color4':'' || 
                index%5==4?'top_color5':'','panic_list']"
                  v-for="(item,index) in paniclist"
                  :key="index"
                >
                  <router-link to="/comdetail" class="panic_list_con">
                    <img class="pan_img" :src="item.image" alt />
                    <div class="pan_name">{{item.name}}</div>
                    <div class="pan_tips">{{item.tips}}</div>
                    <div class="pan_money">
                      <span>{{item.money1}}元</span>
                      <del>{{item.money2}}元</del>
                    </div>
                  </router-link>
                </li>
              </ul>
            </div>
          </div>
          <!-- 广告长图1 -->
          <div class="ad_box">
            <img class="ad_img" src="/images/ad/long1.png" alt />
          </div>

          <!-- =================== 手机列表 开始 =================== -->
          <!-- 标题 -->
          <div class="content_title">
            <div class="title_left">手机</div>
            <div class="title_right">
              <!-- 查看更多 -->
              <div class="title_more">
                查看更多
                <i class="iconfont icon-yousx1"></i>
              </div>
            </div>
          </div>
          <!-- 内容 -->
          <div class="con_module">
            <div class="module_left">
              <LeftAd :left-date="phone_adlist"></LeftAd>
            </div>
            <div class="module_right">
              <right-goods :openlast="false" :goodsData="phonedata"></right-goods>
            </div>
          </div>
          <!-- =================== 手机列表 结束 =================== -->

          <!-- 广告长图2 -->
          <div class="ad_box">
            <img class="ad_img" src="/images/ad/long2.png" alt />
          </div>

          <!-- =================== 家电列表 开始 =================== -->
          <!-- 标题 -->
          <div class="content_title">
            <div class="title_left">家电</div>
            <div class="title_right">
              <!-- 选择选项 -->
              <ul class="select_box">
                <li
                  :class="[jdselectID==index?'active':'','select_list']"
                  v-for="(item,index) in jdselect"
                  :key="index"
                  @mouseenter="jdcheckbtn(index)"
                >{{item}}</li>
              </ul>
            </div>
          </div>
          <!-- 内容 -->
          <div class="con_module">
            <div class="module_left">
              <LeftAd :left-date="jd_adlist"></LeftAd>
            </div>
            <div class="module_right" v-if="jdselectID == 0">
              <right-goods :goodsData="jd_remen" :lastgoodData="jd_remen_last"></right-goods>
            </div>
            <div class="module_right" v-if="jdselectID == 1">
              <right-goods :goodsData="jd_dsyy" :lastgoodData="jd_dsyy_last"></right-goods>
            </div>
          </div>
          <!-- =================== 家电列表 结束 =================== -->

          <!-- 广告长图3 -->
          <div class="ad_box">
            <img class="ad_img" src="/images/ad/long3.png" alt />
          </div>

          <!-- =================== 智能列表 开始 =================== -->
          <!-- 标题 -->
          <div class="content_title">
            <div class="title_left">智能</div>
            <div class="title_right">
              <!-- 选择选项 -->
              <ul class="select_box">
                <li
                  :class="[znselectID==index?'active':'','select_list']"
                  v-for="(item,index) in znselect"
                  :key="index"
                  @mouseenter="zncheckbtn(index)"
                >{{item}}</li>
              </ul>
            </div>
          </div>
          <!-- 内容 -->
          <div class="con_module">
            <div class="module_left">
              <LeftAd :left-date="zn_adlist"></LeftAd>
            </div>
            <div class="module_right" v-if="znselectID == 0">
              <right-goods :goodsData="zn_remen" :lastgoodData="zn_remen_last"></right-goods>
            </div>
            <div class="module_right" v-if="znselectID == 1">
              <right-goods :goodsData="zn_anfan" :lastgoodData="zn_anfan_last"></right-goods>
            </div>
            <div class="module_right" v-if="znselectID == 2">
              <right-goods :goodsData="zn_chuxing" :lastgood="false"></right-goods>
            </div>
          </div>
          <!-- =================== 智能列表 结束 =================== -->

          <!-- 广告长图4 -->
          <div class="ad_box">
            <img class="ad_img" src="/images/ad/long4.png" alt />
          </div>

          <!-- =================== 视频列表 开始 =================== -->
          <!-- 标题 -->
          <div class="content_title">
            <div class="title_left">视频</div>
            <div class="title_right">
              <!-- 查看更多 -->
              <div class="title_more">
                查看更多
                <i class="iconfont icon-yousx1"></i>
              </div>
            </div>
          </div>
          <div class="videolist">
            <video-list></video-list>
          </div>
          <!-- =================== 视频列表 结束 =================== -->
        </div>
      </div>
    </section>
    <!-- 页脚 -->
    <footer>
      <Footer></Footer>
    </footer>
  </div>
</template>
<script>
import MainNav from "../components/MainNav/MainNav.vue";
import Banner from "../components/Banner/Banner.vue";
import LeftAd from "../components/LeftAd/LeftAd.vue";
import RightGoods from "../components/RightGoods/RightGoods.vue";
import VideoList from "../components/VideoList/VideoList.vue";
import Footer from "../components/Footer/Footer.vue";
export default {
  name: "app",
  data() {
    return {
      // 倒计时
      Panicshow: 0,
      startTimetext: "",
      startTime: "12:00:00",
      // nowTime: "21:59:56", // 用于测试
      endTime: "22:00:00",
      hr: "00",
      min: "00",
      sec: "00",

      // 小米抢购
      panicstyle: 0,
      panicID: 4,
      paincheck_left: true,
      paincheck_right: false,
      paniclist: [
        {
          image: "/images/pan1.jpg",
          name: "1米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "2米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "3米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "4米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "5米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "6米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "7米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "8米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "9米家扫地机器人1S 白色aaa",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "10米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "11米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "12米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "13米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        },
        {
          image: "/images/pan1.jpg",
          name: "14米家扫地机器人1S 白色",
          tips: "看得明白扫得彻底",
          money1: "1799",
          money2: "1999"
        }
      ],

      // 手机列表
      phone_adlist: ["/images/ad/he1.png"],
      phonedata: [
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        },
        {
          goodsImg: "/images/goods/phone1.png",
          goodsName: "小米 10 Pro",
          goodsExplain: "骁龙865/1亿像素相机",
          money1: "4999",
          qishow: true,
          delmoney: "5999"
        }
      ],

      // 家电列表
      jdselectID: 0,
      jdselect: ["热门", "电视影音"],
      jd_adlist: ["/images/ad/sp1.png", "/images/ad/sp2.png"],
      jd_remen: [
        {
          goodsImg: "/images/goods/jd1.png",
          goodsName: "米家互联网空调C1（一级能效）",
          goodsExplain: "变频节能省电，自清洁",
          money1: "2699",
          qishow: false
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd1.png",
          goodsName: "米家互联网空调C1（一级能效）",
          goodsExplain: "变频节能省电，自清洁",
          money1: "2699",
          qishow: false
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd1.png",
          goodsName: "米家互联网空调C1（一级能效）",
          goodsExplain: "变频节能省电，自清洁",
          money1: "2699",
          qishow: false
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd1.png",
          goodsName: "米家互联网空调C1（一级能效）",
          goodsExplain: "变频节能省电，自清洁",
          money1: "2699",
          qishow: false
        }
      ],
      jd_remen_last: [
        {
          lastGoodName: 'Air 13.3" 2019款',
          lastGoodMoney: "4999",
          lastGoodImg: "/images/goods/jd_last1.png",
          qishow: true
        }
      ],
      jd_dsyy: [
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: false,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: false,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: false,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/jd2.png",
          goodsName: "小米全面屏电视E55A",
          goodsExplain: "全面屏设计，人工智能语音",
          money1: "1899",
          qishow: false,
          delmoney: "1999"
        }
      ],
      jd_dsyy_last: [
        {
          lastGoodName: "小米盒子4",
          lastGoodMoney: "299",
          lastGoodImg: "/images/goods/jd_last2.png",
          qishow: false
        }
      ],

      // 智能列表
      znselectID: 0,
      znselect: ["热门", "安防", "出行"],
      zn_adlist: ["/images/ad/sp3.png", "/images/ad/sp4.png"],
      zn_remen: [
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        },
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        },
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        },
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        },
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        },
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        },
        {
          goodsImg: "/images/goods/zn1.png",
          goodsName: "小米「小爱老师」",
          goodsExplain: "口袋里的英语外教",
          money1: "449",
          qishow: true,
          delmoney: "499"
        }
      ],
      zn_remen_last: [
        {
          lastGoodName: "小米体脂秤 2",
          lastGoodMoney: "299",
          lastGoodImg: "/images/goods/zn_last1.png",
          qishow: false
        }
      ],
      zn_anfan: [
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        },
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        },
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        },
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        },
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        },
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        },
        {
          goodsImg: "/images/goods/zn2.png",
          goodsName: "小米米家智能门锁 推拉式",
          goodsExplain: "一步推拉，高端智能门锁",
          money1: "1699"
        }
      ],
      zn_anfan_last: [
        {
          lastGoodName: "小米米家智能摄像机云台版",
          lastGoodMoney: "179",
          lastGoodImg: "/images/goods/zn_last2.png",
          qishow: false
        }
      ],
      zn_chuxing: [
        {
          goodsImg: "/images/goods/zn3.png",
          goodsName: "小米米家电动滑板车",
          goodsExplain: "便携折叠，自由穿行",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/zn3.png",
          goodsName: "小米米家电动滑板车",
          goodsExplain: "便携折叠，自由穿行",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/zn3.png",
          goodsName: "小米米家电动滑板车",
          goodsExplain: "便携折叠，自由穿行",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        },
        {
          goodsImg: "/images/goods/zn3.png",
          goodsName: "小米米家电动滑板车",
          goodsExplain: "便携折叠，自由穿行",
          money1: "1899",
          qishow: true,
          delmoney: "1999"
        }
      ]
    };
  },
  mounted: function() {
    this.startTimetext = this.startTime.slice(0, 5);
    this.countdown();
    // 切换页面时滚动条自动滚动到顶部
    window.scrollTo(0, 0);
  },
  methods: {
    // 小米抢购
    // 向左按钮
    panicleftbtn: function() {
      var width = 248; // 每个列表的宽度
      // 判断列表显示的id是否最大值为4
      if (this.panicID <= 4) {
        this.panicID = 4; // 将列表默认值设置为4
        this.paincheck_left = true;
      } else {
        // 将id 减去 4 用于判断是否剩余个数超过4个
        var num = this.panicID - 4;
        if (num >= 4) {
          // 剩余列表超过4个
          this.panicID = this.panicID - 4; // 减去已经滑动过的4个数列表数
          this.panicstyle = this.panicstyle + 4 * width; // 设置滚动距离
          this.paincheck_right = false;
          // 判断如果是小于等于4的话就禁止点击按钮
          if (this.panicID <= 4) {
            this.paincheck_left = true;
          }
        } else if (num < 4) {
          // 剩余列表不超过4个
          this.panicID = this.panicID - num; // 减去剩下的列表个数
          this.panicstyle = this.panicstyle + num * width; // 设置滚动距离
          this.paincheck_left = true;
        }
      }
    },
    // 向右按钮
    panicrightbtn: function() {
      var width = 248; // 每个列表的宽度
      var length = this.paniclist.length; // 数组列表的总长度
      var num = length - this.panicID; // 计算剩下的列表个数
      // 判断剩余的列表数量是否超过4个
      if (num >= 4) {
        this.panicstyle = this.panicstyle - 4 * width; // 设置滚动距离
        this.panicID = this.panicID + 4; // 将以滚动的列表数相加
        this.paincheck_left = false;
      } else if (num < 4) {
        // 如果少于4个
        this.panicID = this.panicID + num; // 将以滚动的列表数相加剩下的列表个数
        this.panicstyle = this.panicstyle - num * width; // 设置滚动距离
        this.paincheck_right = true;
      }
    },

    // 倒计时
    countdown: function() {
      var _this = this;
      // 获取系统日期
      var year = new Date().getFullYear();
      var month = new Date().getMonth() + 1;
      var strDate = new Date().getDate();
      // 设置日期为系统当天的日期
      var date = year + "-" + month + "-" + strDate;

      // 设置项目的每天的日期都为当天的
      var startTime = date + " " + this.startTime;
      var endTime = date + " " + this.endTime;
      // var nowTime = date + " " + this.nowTime; // 测试使用
      // 获取时间戳
      var start = Date.parse(startTime); // 活动开始时间
      var now = Date.parse(new Date()); // 系统当前时间
      //   var now = Date.parse(nowTime); // 测试使用
      var end = Date.parse(endTime); // 活动结束时间
      // 获取时间戳总秒数 所以要出去1000毫秒
      var msec = (end - now) / 1000;
      if (start <= now) {
        _this.Panicshow = 1;
        //   设置定时器
        var ins = setInterval(function() {
          if (msec >= 0) {
            // 计算时分秒数
            let h = parseInt((msec / 60 / 60) % 24);
            let m = parseInt((msec / 60) % 60);
            let s = parseInt(msec % 60);
            msec--;
            // 赋值
            _this.hr = h > 9 ? h : "0" + h;
            _this.min = m > 9 ? m : "0" + m;
            _this.sec = s > 9 ? s : "0" + s;
          } else {
            //   清除定时器
            clearInterval(ins);
            _this.Panicshow = 2;
          }
        }, 1000);
      } else {
        _this.Panicshow = 0;
      }
    },

    // 家电列表 事件
    jdcheckbtn: function(index) {
      this.jdselectID = index;
    },

    // 智能列表 事件
    zncheckbtn: function(index) {
      this.znselectID = index;
    }
  },
  components: {
    MainNav,
    Banner,
    LeftAd,
    RightGoods,
    VideoList,
    Footer
  }
};
</script>
<style lang="scss" scoped>
@import "../assets/scss/index.scss";
</style>